DROP TABLE CRST_RA_CUSTOMER_TRX_ALL;

CREATE TABLE CRST_RA_CUSTOMER_TRX_ALL
(
  CUSTOMER_TRX_ID                 NUMBER(15)    NOT NULL,
  LAST_UPDATE_DATE                DATE          NOT NULL,
  LAST_UPDATED_BY                 NUMBER(15)    NOT NULL,
  CREATION_DATE                   DATE          NOT NULL,
  CREATED_BY                      NUMBER(15)    NOT NULL,
  LAST_UPDATE_LOGIN               NUMBER(15),
  TRX_NUMBER                      VARCHAR2(20 BYTE) NOT NULL,
  CUST_TRX_TYPE_ID                NUMBER(15)    NOT NULL,
  TRX_DATE                        DATE          NOT NULL,
  SET_OF_BOOKS_ID                 NUMBER(15)    NOT NULL,
  BILL_TO_CONTACT_ID              NUMBER(15),
  BATCH_ID                        NUMBER(15),
  BATCH_SOURCE_ID                 NUMBER(15),
  REASON_CODE                     VARCHAR2(30 BYTE),
  SOLD_TO_CUSTOMER_ID             NUMBER(15),
  SOLD_TO_CONTACT_ID              NUMBER(15),
  SOLD_TO_SITE_USE_ID             NUMBER(15),
  BILL_TO_CUSTOMER_ID             NUMBER(15),
  BILL_TO_SITE_USE_ID             NUMBER(15),
  SHIP_TO_CUSTOMER_ID             NUMBER(15),
  SHIP_TO_CONTACT_ID              NUMBER(15),
  SHIP_TO_SITE_USE_ID             NUMBER(15),
  SHIPMENT_ID                     NUMBER(15),
  REMIT_TO_ADDRESS_ID             NUMBER(15),
  TERM_ID                         NUMBER(15),
  TERM_DUE_DATE                   DATE,
  PREVIOUS_CUSTOMER_TRX_ID        NUMBER(15),
  PRIMARY_SALESREP_ID             NUMBER(15),
  PRINTING_ORIGINAL_DATE          DATE,
  PRINTING_LAST_PRINTED           DATE,
  PRINTING_OPTION                 VARCHAR2(20 BYTE),
  PRINTING_COUNT                  NUMBER(15),
  PRINTING_PENDING                VARCHAR2(1 BYTE),
  PURCHASE_ORDER                  VARCHAR2(50 BYTE),
  PURCHASE_ORDER_REVISION         VARCHAR2(50 BYTE),
  PURCHASE_ORDER_DATE             DATE,
  CUSTOMER_REFERENCE              VARCHAR2(30 BYTE),
  CUSTOMER_REFERENCE_DATE         DATE,
  COMMENTS                        VARCHAR2(240 BYTE),
  INTERNAL_NOTES                  VARCHAR2(240 BYTE),
  EXCHANGE_RATE_TYPE              VARCHAR2(30 BYTE),
  EXCHANGE_DATE                   DATE,
  EXCHANGE_RATE                   NUMBER,
  TERRITORY_ID                    NUMBER(15),
  INVOICE_CURRENCY_CODE           VARCHAR2(15 BYTE),
  INITIAL_CUSTOMER_TRX_ID         NUMBER(15),
  AGREEMENT_ID                    NUMBER(15),
  END_DATE_COMMITMENT             DATE,
  START_DATE_COMMITMENT           DATE,
  LAST_PRINTED_SEQUENCE_NUM       NUMBER(15),
  ATTRIBUTE_CATEGORY              VARCHAR2(30 BYTE),
  ATTRIBUTE1                      VARCHAR2(150 BYTE),
  ATTRIBUTE2                      VARCHAR2(150 BYTE),
  ATTRIBUTE3                      VARCHAR2(150 BYTE),
  ATTRIBUTE4                      VARCHAR2(150 BYTE),
  ATTRIBUTE5                      VARCHAR2(150 BYTE),
  ATTRIBUTE6                      VARCHAR2(150 BYTE),
  ATTRIBUTE7                      VARCHAR2(150 BYTE),
  ATTRIBUTE8                      VARCHAR2(150 BYTE),
  ATTRIBUTE9                      VARCHAR2(150 BYTE),
  ATTRIBUTE10                     VARCHAR2(150 BYTE),
  ORIG_SYSTEM_BATCH_NAME          VARCHAR2(40 BYTE),
  POST_REQUEST_ID                 NUMBER(15),
  REQUEST_ID                      NUMBER(15),
  PROGRAM_APPLICATION_ID          NUMBER(15),
  PROGRAM_ID                      NUMBER(15),
  PROGRAM_UPDATE_DATE             DATE,
  FINANCE_CHARGES                 VARCHAR2(1 BYTE),
  COMPLETE_FLAG                   VARCHAR2(1 BYTE) NOT NULL,
  POSTING_CONTROL_ID              NUMBER(15),
  BILL_TO_ADDRESS_ID              NUMBER(15),
  RA_POST_LOOP_NUMBER             NUMBER(15),
  SHIP_TO_ADDRESS_ID              NUMBER(15),
  CREDIT_METHOD_FOR_RULES         VARCHAR2(30 BYTE),
  CREDIT_METHOD_FOR_INSTALLMENTS  VARCHAR2(30 BYTE),
  RECEIPT_METHOD_ID               NUMBER(15),
  ATTRIBUTE11                     VARCHAR2(150 BYTE),
  ATTRIBUTE12                     VARCHAR2(150 BYTE),
  ATTRIBUTE13                     VARCHAR2(150 BYTE),
  ATTRIBUTE14                     VARCHAR2(150 BYTE),
  ATTRIBUTE15                     VARCHAR2(150 BYTE),
  RELATED_CUSTOMER_TRX_ID         NUMBER(15),
  INVOICING_RULE_ID               NUMBER(15),
  SHIP_VIA                        VARCHAR2(30 BYTE),
  SHIP_DATE_ACTUAL                DATE,
  WAYBILL_NUMBER                  VARCHAR2(50 BYTE),
  FOB_POINT                       VARCHAR2(30 BYTE),
  CUSTOMER_BANK_ACCOUNT_ID        NUMBER(15),
  INTERFACE_HEADER_ATTRIBUTE1     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE2     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE3     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE4     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE5     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE6     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE7     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE8     VARCHAR2(30 BYTE),
  INTERFACE_HEADER_CONTEXT        VARCHAR2(30 BYTE),
  DEFAULT_USSGL_TRX_CODE_CONTEXT  VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE10    VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE11    VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE12    VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE13    VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE14    VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE15    VARCHAR2(30 BYTE),
  INTERFACE_HEADER_ATTRIBUTE9     VARCHAR2(30 BYTE),
  DEFAULT_USSGL_TRANSACTION_CODE  VARCHAR2(30 BYTE),
  RECURRED_FROM_TRX_NUMBER        VARCHAR2(20 BYTE),
  STATUS_TRX                      VARCHAR2(30 BYTE),
  DOC_SEQUENCE_ID                 NUMBER(15),
  DOC_SEQUENCE_VALUE              NUMBER(15),
  PAYING_CUSTOMER_ID              NUMBER(15),
  PAYING_SITE_USE_ID              NUMBER(15),
  RELATED_BATCH_SOURCE_ID         NUMBER(15),
  DEFAULT_TAX_EXEMPT_FLAG         VARCHAR2(1 BYTE),
  CREATED_FROM                    VARCHAR2(30 BYTE) NOT NULL,
  ORG_ID                          NUMBER(15),
  WH_UPDATE_DATE                  DATE,
  GLOBAL_ATTRIBUTE1               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE2               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE3               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE4               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE5               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE6               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE7               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE8               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE9               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE10              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE11              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE12              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE13              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE14              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE15              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE16              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE17              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE18              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE19              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE20              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE21              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE22              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE23              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE24              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE25              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE26              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE27              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE28              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE29              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE30              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE_CATEGORY       VARCHAR2(30 BYTE),
  EDI_PROCESSED_FLAG              VARCHAR2(1 BYTE),
  EDI_PROCESSED_STATUS            VARCHAR2(10 BYTE),
  MRC_EXCHANGE_RATE_TYPE          VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_DATE               VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_RATE               VARCHAR2(2000 BYTE),
  PAYMENT_SERVER_ORDER_NUM        VARCHAR2(80 BYTE),
  APPROVAL_CODE                   VARCHAR2(80 BYTE),
  ADDRESS_VERIFICATION_CODE       VARCHAR2(80 BYTE),
  OLD_TRX_NUMBER                  VARCHAR2(20 BYTE),
  BR_AMOUNT                       NUMBER,
  BR_UNPAID_FLAG                  VARCHAR2(1 BYTE),
  BR_ON_HOLD_FLAG                 VARCHAR2(1 BYTE),
  DRAWEE_ID                       NUMBER(15),
  DRAWEE_CONTACT_ID               NUMBER(15),
  DRAWEE_SITE_USE_ID              NUMBER(15),
  REMITTANCE_BANK_ACCOUNT_ID      NUMBER(15),
  OVERRIDE_REMIT_ACCOUNT_FLAG     VARCHAR2(1 BYTE),
  DRAWEE_BANK_ACCOUNT_ID          NUMBER(15),
  SPECIAL_INSTRUCTIONS            VARCHAR2(240 BYTE),
  REMITTANCE_BATCH_ID             NUMBER(15),
  PREPAYMENT_FLAG                 VARCHAR2(1 BYTE),
  CT_REFERENCE                    VARCHAR2(30 BYTE),
  CONTRACT_ID                     NUMBER,
  BILL_TEMPLATE_ID                NUMBER(15),
  CUSTOMER_TRX_ID_N               NUMBER(15)
);
